import React from 'react'
import { BrowserRouter,useRoutes } from 'react-router-dom'
import routes from '~react-pages'
import './App.css'

const App = () =>
{
    //路由列表
    const Routes = () =>
    {
        //设置全局跳转路由函数
        React.navigate = useNavigate()
        //返回自动生成的路由列表
        return useRoutes(routes)
    }

    return (
        <BrowserRouter future={{v7_startTransition: true, v7_relativeSplatPath: true}}>
            <Routes />
        </BrowserRouter>
    )
}

export default App
